﻿using Domain.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace DTO.Admin
{
    public class TaskCategoryOutput
    {
        public int ID { get; set; }
        /// <summary>
        /// 图标
        /// </summary>
        public string Icon { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 副标题
        /// </summary>
        public string SubTitle { get; set; }
        /// <summary>
        /// 字段数据
        /// </summary>
        public string FieldData { get; set; }
        /// <summary>
        /// 任务步骤
        /// </summary>
        public bool NeedTaskStepData { get; set; }
        /// <summary>
        /// 提交数据
        /// </summary>
        public bool NeedSubField { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnable { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
        /// <summary>
        /// 获取字段数据
        /// </summary>
        /// <returns></returns>
        public List<TaskFieldInfo> GetFieldModels
        {
            get
            {
                if (string.IsNullOrWhiteSpace(FieldData)) return null;

                return JsonConvert.DeserializeObject<List<TaskFieldInfo>>(FieldData);

            }
        }
    }
}
